class CreateItems < ActiveRecord::Migration
  def self.up
    create_table :items do |t|
      t.column :name, :text
      t.column :code, :string
      t.column :price, :integer, :default => 0
      t.column :caption, :text
      t.column :url, :text
      t.column :affiliateurl, :text
      t.column :imageflag, :integer, :default => 0
      t.column :smallimageurl, :text
      t.column :mediumimageurl, :text
      t.column :availability, :integer, :default => 0
      t.column :taxflag, :integer, :default => 0
      t.column :postageflag, :integer, :default => 0
      t.column :creditcardflag, :integer, :default => 0
      t.column :shopoftheyearflag, :integer, :default => 0
      t.column :affiliaterate, :integer, :default => 0
      t.column :starttime, :timestamp
      t.column :endTime, :timestamp
      t.column :reviewcount, :integer, :default => 0
      t.column :reviewaverage, :integer, :default => 0
      t.column :shopname, :text
      t.column :shopcode, :string
      t.column :shopurl, :string
      t.column :genreid, :integer, :default => 0
    end
  end

  def self.down
    drop_table :items
  end
end
